load("//bazel:ray.bzl", "ray_cc_library", "ray_cc_test")

ray_cc_library(
    name = "store_client_test_lib",
    hdrs = ["store_client_test_base.h"],
    deps = [
        "//src/ray/common:test_util",
        "//src/ray/gcs/store_client:gcs_redis_store_client",
    ],
)

ray_cc_test(
    name = "redis_store_client_test",
    size = "small",
    srcs = ["redis_store_client_test.cc"],
    args = [
        "$(location //:redis-server)",
        "$(location //:redis-cli)",
    ],
    data = [
        "//:redis-cli",
        "//:redis-server",
    ],
    tags = ["team:core"],
    deps = [
        ":store_client_test_lib",
        "//src/ray/gcs/store_client:gcs_redis_store_client",
        "@boost//:optional",
        "@com_google_googletest//:gtest_main",
    ],
)

ray_cc_test(
    name = "chaos_redis_store_client_test",
    size = "small",
    srcs = ["redis_store_client_test.cc"],
    args = [
        "$(location //:redis-server)",
        "$(location //:redis-cli)",
    ],
    data = [
        "//:redis-cli",
        "//:redis-server",
    ],
    env = {"REDIS_CHAOS": "1"},
    tags = [
        "no_windows",
        "team:core",
    ],
    target_compatible_with = [
        "@platforms//os:linux",
    ],
    deps = [
        ":store_client_test_lib",
        "//src/ray/gcs/store_client:gcs_redis_store_client",
        "@boost//:optional",
        "@com_google_googletest//:gtest_main",
    ],
)

ray_cc_test(
    name = "in_memory_store_client_test",
    size = "small",
    srcs = ["in_memory_store_client_test.cc"],
    tags = ["team:core"],
    deps = [
        ":store_client_test_lib",
        "//src/ray/gcs/store_client:gcs_in_memory_store_client",
        "@com_google_googletest//:gtest_main",
    ],
)

ray_cc_test(
    name = "observable_store_client_test",
    size = "small",
    srcs = ["observable_store_client_test.cc"],
    tags = ["team:core"],
    deps = [
        ":store_client_test_lib",
        "//src/ray/gcs/store_client:gcs_in_memory_store_client",
        "//src/ray/gcs/store_client:gcs_observable_store_client",
        "@com_google_googletest//:gtest_main",
    ],
)
